<?php

?>

<div id="content" class="w920" style="border-top:0;">
	<div class="zhanlan">
		<div class="zlleft">
			<dl>
				<?php if ($this->currentId !== null) {?>
				<dd id="preImage"><a href="/exhibition/show/id/<?php echo $this->ex->id;?><?php echo $this->currentId == 0 ? "" : ("/index/" . ($this->currentId - 1));?>" class="left">left</a></dd>
				<?php }?>
				<dt id="currentImage">
					<?php 
						if ($this->currentId == null) {
					?>
					<div style="height:400px; margin-left:30px; color:white; overflow-y:scroll;"><span style="text-align:center; font-size:13px;"><?php echo $this->ex->title;?>( From: <?php echo $this->ex->start_time;?> To: <?php echo $this->ex->end_time;?>)</span><br/><?php echo $this->ex->summary;?></div>
					</dt>
					<?php
						}else{
					?>
					<a href="/artwork/show/id/<?php echo $this->currentImage->id;?>" target="_blank">
					<img src="<?php echo $this->currentImage->getPhotoWebAccessablePath('400x480'); ?>" alt="<?php echo $this->currentImage->name;?>" />
					</a>
					</dt>
					<?php }?>
					<?php if ($this->currentId + 1 < $this->total) {?>
				<dd id="nextImage"><a href="/exhibition/show/id/<?php echo $this->ex->id;?>/index/<?php echo $this->currentId + 1;?>" class="right">right</a></dd>
					<?php }?>
			</dl>
		</div>
		
		<?php 
		if($this->currentId !== null){
		?>
		<div class="zlright">
			<p><a href="/artists/show/id/<?php echo $this->currentImage->getArtistObj()->id;?>">ARTIST: <?php echo $this->currentImage->getArtistObj()->name;?></a></p>
			<div class="con dis">
				<p>$</p>
			</div>
			<p><a href="#">BASIC INFORMATION</a></p>
			<div class="cs">
				<h2><?php echo $this->currentImage->name;?></h2>
				<dl>
					<dt>Category</dt>
					<dd><?php echo $this->currentImage->getCategoryObj()->getParent()->name;?></dd>
					</dl>
				<dl>
					<dt>Media</dt>
					<dd><?php echo $this->currentImage->getCategoryObj()->name;?></dd>
				</dl>
				<dl>
					<dt>Size</dt>
					<dd><?php echo $this->currentImage->size;?></dd>
				</dl>
				<dl>
					<dt>Date of creation</dt>
					<dd><?php echo $this->currentImage->date_of_creation;?></dd>
				</dl>
				<dl>
					<dt>Subject</dt>
					<dd><?php 
					$subjs = array();
					foreach($this->currentImage->getSubjectsObj() as $subject){
						array_push($subjs, $subject->name);
					}
					echo join(", ", $subjs);
					?></dd>
				</dl>
				
				<dl>
					<dt>Price</dt>
					<dd>
					<span id="price"><?=$this->currentImage->usd_price?></span> <span id="currency">USD</span>
				<p>
					<a href="javascript:changeCurrency('EUR');"><span>EUR</span></a>
					<a href="javascript:changeCurrency('RMB');"><span>RMB</span></a>
					<a href="javascript:changeCurrency('USD');"><span>USD</span></a>
				</p>
					</dd>
					
				</dl>
				<dl>
					<dt>Country</dt>
					<dd>CHINA</dd>
				</dl>
			</div>
			
		</div>
		<script type="text/javascript">
		function changeCurrency(currency) {
			var EUR = <?php echo $this->currentImage->uro_price ? $this->currentImage->uro_price : 0?>;
			var USD = <?php echo $this->currentImage->usd_price ? $this->currentImage->usd_price : 0?>;
			var RMB = <?php echo $this->currentImage->rmb_price ? $this->currentImage->rmb_price : 0?>;
			p = $('#price');
			c = $('#currency');
			if (currency=='USD') {
				p.html(USD);
				c.html('USD');
			} else if (currency=='EUR') {
				p.html(EUR);
				c.html('EUR');
			} else if (currency=='RMB') {
				p.html(RMB);
				c.html('RMB');
			}
		}
		</script>
		<?php 
		}
		?>
	</div>
</div>

